<template>
	<view :style="skin">
		<!-- <jnavbar :title="'订单列表'"></jnavbar> -->
		<!-- <u-tabs active-color="#FF4F11" bar-width="90" :list="tablist" :is-scroll="false" :current="current" @change="tabsChange"></u-tabs> -->
		<!-- <u-tabs-swiper active-color="#FF4F11" bar-width="90" ref="uTabs" :list="tablist" :current="current" @change="tabsChange" swiperWidth="750"></u-tabs-swiper> -->
		<me-tabs v-model="current" :tabs="tablist" :tab-width="130"></me-tabs>
		<!-- <u-gap height="20" bg-color="#F5F5F5"></u-gap> -->
		<swiper class="swiper-box" :current="current" @change="swiperChange">
			<swiper-item v-for="(tab, i) in tablist" :key="i"><ListItem ref="mescrollItem" :i="i" :index="current" :tabs="tablist" :height="height"></ListItem></swiper-item>
		</swiper>
		<nloading></nloading>
		<floatmenu page_id="10"></floatmenu>
		<trolley></trolley>
	</view>
</template>

<script>
import http from '@/common/http.js';
import util from '@/common/util.js';
import ListItem from './list_item.vue';
export default {
	onShareAppMessage() {
		return this.wxShare();
	},
	components: {
		ListItem
	},
	data() {
		return {
			tabIndex: 0,

			page: 1,
			size: 10,
			list: [],
			sum: 0,
			time: 0,
			loadText: {
				loadmore: '轻轻上拉',
				loading: '努力加载中',
				nomore: '实在没有了'
			},
			triggered: true,
			tablist: [
				{
					name: '全部',
					list: [],
					page: 1,
					isno: false,
					hasShow: false,
					status: 'loadmore'
				},
				{
					name: '待支付',
					list: [],
					page: 1,
					state: 1,
					isno: false,
					hasShow: false,
					status: 'loadmore'
				},
				{
					name: '待发货',
					list: [],
					page: 1,
					state: 2,
					isno: false,
					hasShow: false,
					status: 'loadmore'
				},
				{
					name: '待收货',
					list: [],
					page: 1,
					state: 3,
					isno: false,
					hasShow: false,
					status: 'loadmore'
				},
				{
					name: '待核销',
					list: [],
					page: 1,
					state: 12,
					isno: false,
					hasShow: false,
					status: 'loadmore'
				},
				{
					name: '待评价',
					list: [],
					page: 1,
					state: 8,
					isno: false,
					hasShow: false,
					status: 'loadmore'
				},
				{
					name: '已完结',
					list: [],
					page: 1,
					state: 4,
					isno: false,
					hasShow: false,
					status: 'loadmore'
				}
			],
			current: 0, // tabs组件的current值，表示当前活动的tab选项
			swiperCurrent: 0, // swiper组件的current值，表示当前那个swiper-item是活动的
			is_init: false
		};
	},
	async onLoad(params) {
		await this.$getWx
		this.getjuris(['tradeSetting']).then(a => {
			// this.tradeSetting = a.tradeSetting;
		});
		this.height = uni.getSystemInfoSync().windowHeight - uni.upx2px(80) + 'px';
		if (params.tab) {
			this.current = Number(params.tab);
		}
		let _this = this;
		this.judgeLogin(
			() => {
				_this.user = false;
				_this.$store.commit('setlogin', false);
			},
			() => {}
		);
		// this.getOrderList();
	},
	onShow() {
		// this.getOrderList();
	},
	computed:{
		skin() {
			return this.$store.state.skin;
		},
	},
	methods: {
		swiperChange(e) {
			this.current = e.detail.current;
		}
		// 获取订单发票
	}
};
</script>

<style lang="scss">
page {
	padding-top: 0;
}

.page_swiper {
	height: calc(100vh - 100rpx);
}
.swiper-box {
	height: calc(100vh - 80rpx);
}
.uni-block-bar {
	position: fixed;
	top: 0;
	justify-content: space-between;
	height: 80rpx;
	z-index: 100;
	width: 750rpx;

	.item {
		line-height: 78rpx;
		flex: 1;
		color: #696969;

		text {
			display: inline-block;
		}
	}

	.active {
		color: #ff3c29;
		border-bottom: 2rpx solid #ff3c29;
	}
}
</style>
